#include "TileCacheMemory.h"
#ifdef __cplusplus
extern "C" {
#endif
dtStatus nav_FastLZCompressor_compress(FastLZCompressor * c_this,unsigned char const * buffer,int const bufferSize,unsigned char * compressed,int const tmp_arg3,int * compressedSize){
	unsigned char const * c_arg_buffer=(unsigned char const *)(void*)(buffer);
	int const c_arg_bufferSize=bufferSize;
	unsigned char * c_arg_compressed=(unsigned char *)(void*)(compressed);
	int const c_arg_tmp_arg3=tmp_arg3;
	int * c_arg_compressedSize=(int *)(void*)(compressedSize);
	dtStatus c_out = c_this->compress(c_arg_buffer,c_arg_bufferSize,c_arg_compressed,c_arg_tmp_arg3,c_arg_compressedSize);
	dtStatus wrap_out  = (c_out);
	return wrap_out;
}

dtStatus nav_FastLZCompressor_decompress(FastLZCompressor * c_this,unsigned char const * compressed,int const compressedSize,unsigned char * buffer,int const maxBufferSize,int * bufferSize){
	unsigned char const * c_arg_compressed=(unsigned char const *)(void*)(compressed);
	int const c_arg_compressedSize=compressedSize;
	unsigned char * c_arg_buffer=(unsigned char *)(void*)(buffer);
	int const c_arg_maxBufferSize=maxBufferSize;
	int * c_arg_bufferSize=(int *)(void*)(bufferSize);
	dtStatus c_out = c_this->decompress(c_arg_compressed,c_arg_compressedSize,c_arg_buffer,c_arg_maxBufferSize,c_arg_bufferSize);
	dtStatus wrap_out  = (c_out);
	return wrap_out;
}

void nav_FastLZCompressor_Delete(FastLZCompressor * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_FastLZCompressor_DeleteArray(FastLZCompressor * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

FastLZCompressor * nav_NewFastLZCompressor(){
	FastLZCompressor* wrap_out = new FastLZCompressor();
	return wrap_out;
}

FastLZCompressor * nav_FastLZCompressor_IndexArray(FastLZCompressor * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

int nav_FastLZCompressor_maxCompressedSize(FastLZCompressor * c_this,int const bufferSize){
	int const c_arg_bufferSize=bufferSize;
	int c_out = c_this->maxCompressedSize(c_arg_bufferSize);
	int wrap_out  = (c_out);
	return wrap_out;
}

void * nav_LinearAllocator_alloc(LinearAllocator * c_this,size_t const size){
	size_t const c_arg_size=size;
	void * c_out = c_this->alloc(c_arg_size);
	void * wrap_out  = (void *)(void*)(c_out);
	return wrap_out;
}

void nav_LinearAllocator_Delete(LinearAllocator * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_LinearAllocator_DeleteArray(LinearAllocator * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

void nav_LinearAllocator_free(LinearAllocator * c_this,void * tmp_arg0){
	void * c_arg_tmp_arg0=(void *)(void*)(tmp_arg0);
	c_this->free(c_arg_tmp_arg0);
}

unsigned char * * nav_LinearAllocator_GetPtrToBuffer(LinearAllocator * c_this){
	return (unsigned char * *)(&(c_this->buffer));
}

size_t * nav_LinearAllocator_GetPtrToCapacity(LinearAllocator * c_this){
	return (size_t *)(&(c_this->capacity));
}

size_t * nav_LinearAllocator_GetPtrToHigh(LinearAllocator * c_this){
	return (size_t *)(&(c_this->high));
}

size_t * nav_LinearAllocator_GetPtrToTop(LinearAllocator * c_this){
	return (size_t *)(&(c_this->top));
}

LinearAllocator * nav_LinearAllocator_IndexArray(LinearAllocator * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

LinearAllocator * nav_NewLinearAllocator(size_t const cap){
	size_t const c_arg_cap=cap;
	LinearAllocator* wrap_out = new LinearAllocator(c_arg_cap);
	return wrap_out;
}

void nav_LinearAllocator_reset(LinearAllocator * c_this){
	c_this->reset();
}

void nav_LinearAllocator_resize(LinearAllocator * c_this,size_t const cap){
	size_t const c_arg_cap=cap;
	c_this->resize(c_arg_cap);
}

void nav_MeshProcess_Delete(MeshProcess * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_MeshProcess_DeleteArray(MeshProcess * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

InputGeom * * nav_MeshProcess_GetPtrToM_geom(MeshProcess * c_this){
	return (InputGeom * *)(&(c_this->m_geom));
}

MeshProcess * nav_MeshProcess_IndexArray(MeshProcess * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

void nav_MeshProcess_init(MeshProcess * c_this,InputGeom * geom){
	InputGeom * c_arg_geom=(InputGeom *)(void*)(geom);
	c_this->init(c_arg_geom);
}

MeshProcess * nav_NewMeshProcess(){
	MeshProcess* wrap_out = new MeshProcess();
	return wrap_out;
}

void nav_MeshProcess_process(MeshProcess * c_this,dtNavMeshCreateParams * params,unsigned char * polyAreas,unsigned short * polyFlags){
	dtNavMeshCreateParams * c_arg_params=(dtNavMeshCreateParams *)(void*)(params);
	unsigned char * c_arg_polyAreas=(unsigned char *)(void*)(polyAreas);
	unsigned short * c_arg_polyFlags=(unsigned short *)(void*)(polyFlags);
	c_this->process(c_arg_params,c_arg_polyAreas,c_arg_polyFlags);
}

FastLZCompressor * nav_NewFastLZCompressorPtrArray(long n){
	FastLZCompressor* c_this=new FastLZCompressor[n];
	return c_this;
}

MeshProcess * nav_NewMeshProcessPtrArray(long n){
	MeshProcess* c_this=new MeshProcess[n];
	return c_this;
}

#ifdef __cplusplus
}
#endif
